package com.ad_hccm.dao.TreatmentHistory;

import com.ad_hccm.domain.TreatmentHistory.OralMedicine;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * TODO 口服药物Dao
 */
@Mapper
public interface OralMedicineDao {
    @Insert("insert into oral_medicine value(#{id}, #{isAntihistamines}, #{antihistamines}, #{isHormone}, #{hormone}, #{isImmunosuppressant}, #{Immunosuppressant})")
    public boolean save(OralMedicine oralMedicine);

    @Update("update oral_medicine set isAntihistamines = #{isAntihistamines}, antihistamines = #{antihistamines}, isHormone = #{isHormone}, hormone = #{hormone}, isImmunosuppressant = #{isImmunosuppressant}, Immunosuppressant = #{Immunosuppressant} where id=#{id}")
    public boolean update(OralMedicine oralMedicine);

    @Select("select * from oral_medicine where id=#{id}")
    public OralMedicine getById(String id);

    @Select("select * from oral_medicine")
    public List<OralMedicine> getAll();
}